/*     */ package com.lmpop.trade.ti_listadvinfo;
/*     */ 
/*     */ import com.lmpop.frame.QueryList;
/*     */ import com.lmpop.frame.SysMap;
/*     */ import com.lmpop.frame.TradeInterf;
/*     */ import com.lmpop.frame.dao.DbmInterf;
/*     */ import com.lmpop.frame.exp.ApplicationException;
/*     */ import java.util.Hashtable;
/*     */ import java.util.List;
/*     */ 
/*     */ public class Ti_listadvinfoInfo
/*     */   implements TradeInterf
/*     */ {
/*     */   QueryList queryList;
/*     */ 
/*     */   public Ti_listadvinfoInfo()
/*     */   {
/*  16 */     this.queryList = new QueryList();
/*     */   }
/*     */ 
/*     */   public SysMap insert(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  25 */     Ti_listadvinfo ti_listadvinfo = new Ti_listadvinfo();
/*  26 */     ti_listadvinfo.setAdv_id(map.getString("adv_id"));
/*  27 */     ti_listadvinfo.setKey_type(map.getString("key_type"));
/*  28 */     ti_listadvinfo.setAdv_rang(map.getString("adv_rang"));
/*  29 */     ti_listadvinfo.setKey_words(map.getString("key_words"));
/*  30 */     ti_listadvinfo.setAdv_title(map.getString("adv_title"));
/*  31 */     ti_listadvinfo.setAdv_text(map.getString("adv_text"));
/*  32 */     ti_listadvinfo.setStart_date(map.getString("start_date"));
/*  33 */     ti_listadvinfo.setEnd_date(map.getString("end_date"));
/*  34 */     ti_listadvinfo.setAdv_post(map.getInt("adv_post"));
/*  35 */     ti_listadvinfo.setPrice(map.getString("price"));
/*  36 */     ti_listadvinfo.setAdv_url(map.getString("adv_url"));
/*  37 */     ti_listadvinfo.setContact(map.getString("contact"));
/*  38 */     ti_listadvinfo.setContact_info(map.getString("contact_info"));
/*  39 */     ti_listadvinfo.setUser_id(map.getString("user_id"));
/*  40 */     ti_listadvinfo.setIn_date(map.getString("in_date"));
/*  41 */     ti_listadvinfo.setRemark(map.getString("remark"));
/*     */ 
/*  44 */     String result_code = "0";
/*     */     try {
/*  46 */       insert(dbmMgr, ti_listadvinfo);
/*     */     } catch (ApplicationException e) {
/*  48 */       e.printStackTrace();
/*  49 */       result_code = "1";
/*     */     }
/*  51 */     map.setString("result_code", result_code);
/*  52 */     return map;
/*     */   }
/*     */ 
/*     */   public void insert(DbmInterf dbmMgr, Ti_listadvinfo ti_listadvinfo)
/*     */     throws ApplicationException
/*     */   {
/*  61 */     dbmMgr.update("insertTi_listadvinfo", ti_listadvinfo);
/*     */   }
/*     */ 
/*     */   public SysMap delete(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  71 */     String pkid_string = map.getString("pkid");
/*  72 */     String result_code = "0";
/*     */     try {
/*  74 */       if (!pkid_string.equals("")) {
/*  75 */         String[] pkStr = pkid_string.split("\\|");
/*  76 */         for (int i = 0; i < pkStr.length; i++) {
/*  77 */           if (pkStr[i].equals("")) continue; delete(dbmMgr, pkStr[i]);
/*     */         }
/*     */       }
/*     */     } catch (ApplicationException e) {
/*  81 */       e.printStackTrace();
/*  82 */       result_code = "1";
/*     */     }
/*  84 */     map.setString("result_code", result_code);
/*  85 */     return map;
/*     */   }
/*     */ 
/*     */   public void delete(DbmInterf dbmMgr, String pkid)
/*     */     throws ApplicationException
/*     */   {
/*  94 */     dbmMgr.update("deleteTi_listadvinfo", pkid);
/*     */   }
/*     */ 
/*     */   public SysMap update(DbmInterf dbmMgr, SysMap map)
/*     */   {
/* 103 */     Ti_listadvinfo ti_listadvinfo = new Ti_listadvinfo();
/* 104 */     ti_listadvinfo.setAdv_id(map.getString("adv_id"));
/* 105 */     ti_listadvinfo.setKey_type(map.getString("key_type"));
/* 106 */     ti_listadvinfo.setAdv_rang(map.getString("adv_rang"));
/* 107 */     ti_listadvinfo.setKey_words(map.getString("key_words"));
/* 108 */     ti_listadvinfo.setAdv_title(map.getString("adv_title"));
/* 109 */     ti_listadvinfo.setAdv_text(map.getString("adv_text"));
/* 110 */     ti_listadvinfo.setStart_date(map.getString("start_date"));
/* 111 */     ti_listadvinfo.setEnd_date(map.getString("end_date"));
/* 112 */     ti_listadvinfo.setAdv_post(map.getInt("adv_post"));
/* 113 */     ti_listadvinfo.setPrice(map.getString("price"));
/* 114 */     ti_listadvinfo.setAdv_url(map.getString("adv_url"));
/* 115 */     ti_listadvinfo.setContact(map.getString("contact"));
/* 116 */     ti_listadvinfo.setContact_info(map.getString("contact_info"));
/* 117 */     ti_listadvinfo.setUser_id(map.getString("user_id"));
/* 118 */     ti_listadvinfo.setIn_date(map.getString("in_date"));
/* 119 */     ti_listadvinfo.setRemark(map.getString("remark"));
/*     */ 
/* 121 */     String result_code = "0";
/*     */     try {
/* 123 */       update(dbmMgr, ti_listadvinfo);
/*     */     } catch (ApplicationException e) {
/* 125 */       e.printStackTrace();
/* 126 */       result_code = "1";
/*     */     }
/* 128 */     map.setString("result_code", result_code);
/* 129 */     return map;
/*     */   }
/*     */ 
/*     */   public void update(DbmInterf dbmMgr, Ti_listadvinfo ti_listadvinfo)
/*     */     throws ApplicationException
/*     */   {
/* 138 */     dbmMgr.update("updateTi_listadvinfo", ti_listadvinfo);
/*     */   }
/*     */ 
/*     */   public List getListByPage(Object obj, int start, int limit)
/*     */   {
/* 148 */     Hashtable Ti_listadvinfo = (Hashtable)obj;
/* 149 */     if (start == 0)
/* 150 */       start = 0;
/*     */     else {
/* 152 */       start = (start - 1) * limit;
/*     */     }
/* 154 */     Ti_listadvinfo.put("start", Integer.valueOf(start));
/* 155 */     Ti_listadvinfo.put("limit", Integer.valueOf(limit));
/*     */ 
/* 157 */     return this.queryList.getList("getListByTi_listadvinfoPage", Ti_listadvinfo);
/*     */   }
/*     */ 
/*     */   public int getCountByObj(Object obj)
/*     */   {
/* 168 */     Hashtable Ti_listadvinfo = (Hashtable)obj;
/*     */ 
/* 170 */     List list = this.queryList.getList("getCountByObjTi_listadvinfo", Ti_listadvinfo);
/* 171 */     int count = 0;
/* 172 */     if ((list != null) && (list.size() > 0)) {
/* 173 */       Hashtable newsMap = (Hashtable)list.get(0);
/* 174 */       if ((newsMap.get("count") != null) && (!newsMap.get("count").toString().equals(""))) {
/* 175 */         count = Integer.parseInt(newsMap.get("count").toString());
/*     */       }
/*     */     }
/* 178 */     return count;
/*     */   }
/*     */ 
/*     */   public List getListByPk(String pk)
/*     */   {
/* 188 */     return this.queryList.getList("getTi_listadvinfoByPk", pk);
/*     */   }
/*     */ 
/*     */   public List getListByPageSort(Object obj, int start, int limit)
/*     */   {
/* 201 */     Hashtable Ti_listadvinfo = (Hashtable)obj;
/* 202 */     if (start == 0)
/* 203 */       start = 0;
/*     */     else {
/* 205 */       start = (start - 1) * limit;
/*     */     }
/* 207 */     Ti_listadvinfo.put("start", Integer.valueOf(start));
/* 208 */     Ti_listadvinfo.put("limit", Integer.valueOf(limit));
/*     */ 
/* 210 */     return this.queryList.getList("getListByTi_listadvinfoPageSort", Ti_listadvinfo);
/*     */   }
/*     */ 
/*     */   public int getCountByObjSort(Object obj)
/*     */   {
/* 221 */     Hashtable Ti_listadvinfo = (Hashtable)obj;
/* 222 */     List list = this.queryList.getList("getCountByObjTi_listadvinfoSort", Ti_listadvinfo);
/* 223 */     int count = 0;
/* 224 */     if ((list != null) && (list.size() > 0)) {
/* 225 */       Hashtable newsMap = (Hashtable)list.get(0);
/* 226 */       if ((newsMap.get("count") != null) && (!newsMap.get("count").toString().equals(""))) {
/* 227 */         count = Integer.parseInt(newsMap.get("count").toString());
/*     */       }
/*     */     }
/* 230 */     return count;
/*     */   }
/*     */ }

/* Location:           F:\电商\commons-utils.jar
 * Qualified Name:     com.lmpop.trade.ti_listadvinfo.Ti_listadvinfoInfo
 * JD-Core Version:    0.6.0
 */